﻿<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="copyright" content="" />
<title>妖罗万象GM工具</title>
<link rel="stylesheet" type="text/css" href="easyUI/1.5.5.4/themes/bootstrap/easyui.css" />
<link rel="stylesheet" type="text/css" href="css/wu.css" />
<link rel="stylesheet" type="text/css" href="css/icon.css" />
<script type="text/javascript" src="js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="easyUI/1.5.5.4/jquery.easyui.min.js"></script>
<script type="text/javascript" src="easyUI/1.5.5.4/locale/easyui-lang-zh_CN.js"></script>

</head>
<body class="easyui-layout">
	<!-- begin of header -->
	<div class="wu-header" data-options="region:'north',border:false,split:true">
    	<div class="wu-header-left">
        	<h1>妖罗万象GM工具</h1>
        </div>
        <div class="wu-header-right">
        	<p><strong class="easyui-tooltip" title="2条未读消息">admin</strong>，欢迎您！</p>
            <p><a href="#">网站首页</a>|<a href="#">支持论坛</a>|<a href="#">帮助中心</a>|<a href="logout">安全退出</a></p>
        </div>
    </div>
    <!-- end of header -->
    <!-- begin of sidebar -->
	<div class="wu-sidebar" data-options="region:'west',split:true,border:true,title:'导航菜单'"> 
    	<div class="easyui-accordion" data-options="border:false,fit:true"> 
            <div title="数据分析" data-options="iconCls:'icon-application-cascade'" style="padding:5px;">
                <ul class="easyui-tree wu-side-tree">
                    <li iconCls="icon-chart-line"><a href="javascript:void(0)" data-icon="icon-chart-line" data-link="pages/analyse/damageTest.html" iframe="1">伤害监控</a></li>
                    <li iconCls="icon-chart-line"><a href="javascript:void(0)" data-icon="icon-chart-line" data-link="pages/analyse/damageShow.html" iframe="1">伤害数据显示</a></li>
                </ul>
            </div>
        </div>
    </div>	
    <!-- end of sidebar -->    
    <!-- begin of main -->
    <div class="wu-main" data-options="region:'center'">
        <div id="wu-tabs" class="easyui-tabs" data-options="border:false,fit:true">  
            <div title="首页" data-options="closable:false,iconCls:'icon-tip',cls:'pd3'">
                <iframe scrolling="auto" frameborder="0"  src="pages/firstPage.html" style="width:99%;height:99%;"></iframe>
            </div>
        </div>
    </div>
    <!-- end of main --> 
    <!-- begin of footer -->
	<div class="wu-footer" data-options="region:'south',border:true,split:true">
        -------------------------
    </div>
    <!-- end of footer -->  
    <script type="text/javascript">
		$(function(){
			$('.wu-side-tree li').bind("click",function(){
                let myTarget = $(this).find('a');
                console.log(myTarget.attr('iframe'));
                let title = myTarget.text();
                let url = myTarget.attr('data-link');
                let iconCls = myTarget.attr('data-icon');
                let iframe = myTarget.attr('iframe')==1?true:false;

				addTab(title,url,iconCls,iframe);
			});	
		})
		
		// /**
		// * Name 载入树形菜单
		// */
		// $('#wu-side-tree').tree({
		// 	url:'temp/menu.php',
		// 	cache:false,
		// 	onClick:function(node){
		// 		var url = node.attributes['url'];
		// 		if(url==null || url == ""){
		// 			return false;
		// 		}
		// 		else{
		// 			addTab(node.text, url, '', node.attributes['iframe']);
		// 		}
		// 	}
		// });
        //
		// /**
		// * Name 选项卡初始化
		// */
		// $('#wu-tabs').tabs({
		// 	tools:[{
		// 		iconCls:'icon-reload',
		// 		border:false,
		// 		handler:function(){
		// 			$('#wu-datagrid').datagrid('reload');
		// 		}
		// 	}]
		// });
		//
		/**
		* Name 添加菜单选项
		* Param title 名称
		* Param href 链接
		* Param iconCls 图标样式
		* Param iframe 链接跳转方式（true为iframe，false为href）
		*/	
		function addTab(title, href, iconCls, iframe){
			let tabPanel = $('#wu-tabs');
			if(!tabPanel.tabs('exists',title)){
                let content = '<iframe scrolling="auto" frameborder="0"  src="'+ href +'" style="width:99%;height:99%;"></iframe>';
				if(iframe){
					tabPanel.tabs('add',{
						title:title,
						content:content,
						iconCls:iconCls,
						fit:true,
						cls:'pd3',
						closable:true
					});
				}
				else{
					tabPanel.tabs('add',{
						title:title,
						href:href,
						iconCls:iconCls,
						fit:true,
						cls:'pd3',
						closable:true
					});
				}
			}
			else
			{
				tabPanel.tabs('select',title);
			}
		}
		/**
		* Name 移除菜单选项
		*/
		function removeTab(){
            let tabPanel = $('#wu-tabs');
            let tab = tabPanel.tabs('getSelected');
			if (tab){
                let index = tabPanel.tabs('getTabIndex', tab);
				tabPanel.tabs('close', index);
			}
		}
	</script>
</body>
</html>
